import request from '@/config/axios'

// 书籍漂入 VO
export interface LwBookInApplyVO {
  lwBookIds: string // 书籍id集合
  applyUid: number // 申请人id
  processStatus: number // 流程状态
  initialReviewUid: number // 初审人
  initialReviewDes: string // 初审说明
  finalReviewUid: number // 终审人
  finalReviewDes: string // 终审说明
  remark: string // 备注
  applyName: string // 备注
  finalReviewName: string // 备注
  initialReviewName: string // 备注
  books: any // 备注
}

// 书籍漂入 API
export const LwBookInApplyApi = {
  // 查询书籍漂入分页
  getLwBookInApplyPage: async (params: any) => {
    return await request.get({ url: `/bk/lw-book-in-apply/page`, params })
  },

  // 查询书籍漂入详情
  getLwBookInApply: async (id: number) => {
    return await request.get({ url: `/bk/lw-book-in-apply/get?id=` + id })
  },

  // 新增书籍漂入
  createLwBookInApply: async (data: LwBookInApplyVO) => {
    return await request.post({ url: `/bk/lw-book-in-apply/create`, data })
  },

  // 修改书籍漂入
  updateLwBookInApply: async (data: LwBookInApplyVO) => {
    return await request.put({ url: `/bk/lw-book-in-apply/update`, data })
  },

  // 删除书籍漂入
  deleteLwBookInApply: async (id: number) => {
    return await request.delete({ url: `/bk/lw-book-in-apply/delete?id=` + id })
  },

  // 导出书籍漂入 Excel
  exportLwBookInApply: async (params) => {
    return await request.download({ url: `/bk/lw-book-in-apply/export-excel`, params })
  },

  // 漂入初审
  inBookFirstExamine: async (data: any) => {
    return await request.post({ url: `/bk/lw-book-in-apply/firstExamine`, data })
  },

  // 漂入终审
  inBookFinaleExamine: async (data: any) => {
    return await request.post({ url: `/bk/lw-book-in-apply/finaleExamine`, data })
  },

  // 漂入终审
  applyBooks: async (data: any) => {
    return await request.post({ url: `/bk/lw-book-in-apply/applyBooks`, data })
  },

  // 获取导入模板
  importTemplate: async () => {
    return await request.download({ url: `/bk/lw-book-in-apply/get-import-template` })
  },
}
